{% extends "base.html" %}


{% block content %}


<div class=info>
  <pre id="status">

  </pre>
</div>

<p>
<button command="play" type=button class=midbutton>play</button>
<button command="stop" type=button  class=midbutton>stop</button>
<button command="pause" type=button  class=midbutton>pause</button>
<button command="chapter0" type=button  class=midbutton>movie start</button>
</p>
<p>
<button command="prev" type=button  class=midbutton>prev</button>
<button command="next" type=button  class=midbutton>next</button>
</p>
<p>
<button command="vol+" type=button  class=midbutton>vol+</button>
<button command="vol-" type=button  class=midbutton>vol-</button>
</p>
<p>
<button command="speed+" type=button  class=midbutton>speed+</button>
<button command="speed-" type=button  class=midbutton>speed-</button>
</p>
<p>
<button command="seek_rel -20" type=button  class=midbutton>rrrev</button>
<button command="seek_rel -5" type=button  class=midbutton>rrev</button>
<button command="seek_rel -1" type=button  class=midbutton>rev</button>
<button command="seek_rel +1" type=button  class=midbutton>fwd</button>
<button command="seek_rel +5" type=button  class=midbutton>ffwd</button>
<button command="seek_rel +20" type=button  class=midbutton>fffwd</button>
</p>
<hr/>
<button command="fullscreen" type=button  class=midbutton>fullscreen</button>
<button command="launch ''" type=button  class=midbutton>launch</button>
<button command="kill" type=button  class=midbutton>kill</button>


<script>
$(function() {
    console.log("vlc setup");
    function SendCommand(command) {
        console.log(command);
        $.get("/vlc_command", {command: command});
    }

    function ButtonClick() {
         var command = $(this).attr("command");
         SendCommand(command);
    }

    function SetStatus(data, html_status) {
        //console.log("command completed [" + status + "]");
        //console.log("command completed [" + data + "]");
        $("#status").html(data);

    }

    function UpdateStatus() {
        $.get("/vlc_command", {command: "status"}, SetStatus);
    }

    $("button").click(ButtonClick);
    UpdateStatus();
    setInterval(UpdateStatus, 2000);
 });

 </script>

{% end %}
